﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using OntologyUtility.Interfaces;
using OntologyFormDesigner.Interfaces;

namespace OntologyFormDesigner.GuiComponent
{
    public class WizardPanel : Panel, IWizardPage
    {
        public Control Control { get; set; }
        public WizardPanel(Control control)
        {
            Control = control;
            createControl();
        }

        public WizardPanel(IContainer container)
        {
            container.Add(this);
           // createControl();
        }

        public bool canFlipToNextPage()
        {
            if (PageComplete)
            {
                wizardForm.Next();
                return true;
            }
            else 
            { 

            }

            return false;
        }

        public bool performFinish()
        {
            return false;
        }

        public string Description
        {
            get
            {
                return description;
            }
            set
            {
                description = value;
            }
        }

        public string ErrorMessage
        {
            get
            {
                return errorMessage;
            }
            set
            {
                errorMessage = value;
            }
        }

        public string Message
        {
            get
            {
                return message;
            }
            set
            {
                message = value;
            }
        }

        public bool PageComplete
        {
            get
            {
                return pageComplete;
            }
            set
            {
                pageComplete = value;
            }
        }

        public String Title
        {
            get
            {
                return title;
            }
            set
            {
                title = value;
            }
        }

        public IWizardPage NextPage
        {
            get
            {
                return nextPage;
            }
            set
            {
                nextPage = value;
            }
        }

        public IWizardPage PreviousPage
        {
            get
            {
                return previousPage;
            }
            set
            {
                previousPage = value;
            }
        }


        public new WizardForm Parent
        {
            get
            {
                return wizardForm;
            }
            set
            {
                wizardForm = value;
            }
        }

        public object ObjectWizard
        {
            get
            {
                return objectWizard;
            }
            set
            {
                objectWizard = value;
            }
        }
        

        public virtual void createControl() {  }
        public virtual void Next() { }
        
        private String description;
        private String errorMessage;
        private String message;
        private Object objectWizard;
        private bool pageComplete;
        private String title;
        private WizardForm wizardForm;
        private OntologyFormDesigner.Interfaces.IWizardPage nextPage;
        private OntologyFormDesigner.Interfaces.IWizardPage previousPage;
    }
}
